﻿@model MiniScrum.Models.User
@{
    ViewBag.Title = "Edit";
}
<h2>
    Edit</h2>
<div>
    @Html.ActionLink("Back to List", "List")
</div>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{  <fieldset>
    <legend>User</legend>
    <div class="wrap">
        <div id="col1">@Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.Id)
            <div class="editor-label">
                @Html.LabelFor(model => model.UserName)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.UserName)
                @Html.ValidationMessageFor(model => model.UserName)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.FullName)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.FullName)
                @Html.ValidationMessageFor(model => model.FullName)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Password)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Password)
                @Html.ValidationMessageFor(model => model.Password)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Email)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Email)
                @Html.ValidationMessageFor(model => model.Email)
            </div>
            <p>
                <input type="submit" value="Save" />
            </p>
        </div>
        <div id="col2">
            <div class="display-label">
                Roles</div>
            @Html.ActionLink("Edit Roles", "UserRoles", "Role", new { id = Model.Id }, null)
            <div>
                <ul id="roles">
                    @if (Model.Roles != null)
                    {
                        foreach (var role in Model.Roles)
                        {
                        <li>@role.RoleName</li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
    </fieldset>
}
